﻿using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// UserInfo数据模型对象
    /// </summary>
    [Serializable]
    public partial class UserInfoMod : IEntity
    {
        /// <summary>
        /// 初始化UserInfo数据模型对象
        /// </summary>
        public UserInfoMod()
        {
            
        }
        /// <summary>
        /// 初始化UserInfo数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="name">Name</param>
        /// <param name="password">Password</param>
        /// <param name="validity">Validity</param>
        /// <param name="modify">Modify</param>
        /// <param name="nextModify">NextModify</param>
        /// <param name="forbid">Forbid</param>
        /// <param name="companyID">CompanyID</param>
        public UserInfoMod(string id,string name,string password,bool validity,bool modify,bool nextModify,bool forbid,string companyID)
        {
            //给Id字段赋值
            this.Id = id;
            //给Name字段赋值
            this.Name = name;
            //给Password字段赋值
            this.Password = password;
            //给Validity字段赋值
            this.Validity = validity;
            //给Modify字段赋值
            this.Modify = modify;
            //给NextModify字段赋值
            this.NextModify = nextModify;
            //给Forbid字段赋值
            this.Forbid = forbid;
            //给CompanyID字段赋值
            this.CompanyID = companyID;
        }
        /// <summary>
        /// 初始化UserInfo数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="name">Name</param>
        /// <param name="password">Password</param>
        /// <param name="deptID">DeptID</param>
        /// <param name="phone">Phone</param>
        /// <param name="scanCode">ScanCode</param>
        /// <param name="email">Email</param>
        /// <param name="spellCode">SpellCode</param>
        /// <param name="remark">Remark</param>
        /// <param name="validity">Validity</param>
        /// <param name="modify">Modify</param>
        /// <param name="nextModify">NextModify</param>
        /// <param name="forbid">Forbid</param>
        /// <param name="fax">Fax</param>
        /// <param name="companyID">CompanyID</param>
        /// <param name="role">Role</param>
        /// <param name="cmdPwd">CmdPwd</param>
        /// <param name="userType">UserType</param>
        public UserInfoMod(string id,string name,string password,string deptID,string phone,string scanCode,string email,string spellCode,string remark,bool validity,bool modify,bool nextModify,bool forbid,string fax,string companyID,string role,string cmdPwd,int? userType)
        {
            //给Id字段赋值
            this.Id = id;
            //给Name字段赋值
            this.Name = name;
            //给Password字段赋值
            this.Password = password;
            //给DeptID字段赋值
            this.DeptID = deptID;
            //给Phone字段赋值
            this.Phone = phone;
            //给ScanCode字段赋值
            this.ScanCode = scanCode;
            //给Email字段赋值
            this.Email = email;
            //给SpellCode字段赋值
            this.SpellCode = spellCode;
            //给Remark字段赋值
            this.Remark = remark;
            //给Validity字段赋值
            this.Validity = validity;
            //给Modify字段赋值
            this.Modify = modify;
            //给NextModify字段赋值
            this.NextModify = nextModify;
            //给Forbid字段赋值
            this.Forbid = forbid;
            //给Fax字段赋值
            this.Fax = fax;
            //给CompanyID字段赋值
            this.CompanyID = companyID;
            //给Role字段赋值
            this.Role = role;
            //给CmdPwd字段赋值
            this.CmdPwd = cmdPwd;
            //给UserType字段赋值
            this.UserType = userType;
        }
        
		//属性存储数据的变量
        private string _id;
        private string _name;
        private string _password;
        private string _deptID;
        private string _phone;
        private string _scanCode;
        private string _email;
        private string _spellCode;
        private string _remark;
        private bool _validity;
        private bool _modify;
        private bool _nextModify;
        private bool _forbid;
        private string _fax;
        private string _companyID;
        private string _role;
        private string _cmdPwd;
        private int? _userType;
        
        /// <summary>
        /// Id
        /// </summary>
        public string Id
        {
            get { return this._id; }
            set { this._id = value; }
        }
        /// <summary>
        /// Name
        /// </summary>
        public string Name
        {
            get { return this._name; }
            set { this._name = value; }
        }
        /// <summary>
        /// Password
        /// </summary>
        public string Password
        {
            get { return this._password; }
            set { this._password = value; }
        }
        /// <summary>
        /// DeptID
        /// </summary>
        public string DeptID
        {
            get { return this._deptID; }
            set { this._deptID = value; }
        }
        /// <summary>
        /// Phone
        /// </summary>
        public string Phone
        {
            get { return this._phone; }
            set { this._phone = value; }
        }
        /// <summary>
        /// ScanCode
        /// </summary>
        public string ScanCode
        {
            get { return this._scanCode; }
            set { this._scanCode = value; }
        }
        /// <summary>
        /// Email
        /// </summary>
        public string Email
        {
            get { return this._email; }
            set { this._email = value; }
        }
        /// <summary>
        /// SpellCode
        /// </summary>
        public string SpellCode
        {
            get { return this._spellCode; }
            set { this._spellCode = value; }
        }
        /// <summary>
        /// Remark
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// Validity
        /// </summary>
        public bool Validity
        {
            get { return this._validity; }
            set { this._validity = value; }
        }
        /// <summary>
        /// Modify
        /// </summary>
        public bool Modify
        {
            get { return this._modify; }
            set { this._modify = value; }
        }
        /// <summary>
        /// NextModify
        /// </summary>
        public bool NextModify
        {
            get { return this._nextModify; }
            set { this._nextModify = value; }
        }
        /// <summary>
        /// Forbid
        /// </summary>
        public bool Forbid
        {
            get { return this._forbid; }
            set { this._forbid = value; }
        }
        /// <summary>
        /// Fax
        /// </summary>
        public string Fax
        {
            get { return this._fax; }
            set { this._fax = value; }
        }
        /// <summary>
        /// CompanyID
        /// </summary>
        public string CompanyID
        {
            get { return this._companyID; }
            set { this._companyID = value; }
        }
        /// <summary>
        /// Role
        /// </summary>
        public string Role
        {
            get { return this._role; }
            set { this._role = value; }
        }
        /// <summary>
        /// CmdPwd
        /// </summary>
        public string CmdPwd
        {
            get { return this._cmdPwd; }
            set { this._cmdPwd = value; }
        }
        /// <summary>
        /// UserType
        /// </summary>
        public int? UserType
        {
            get { return this._userType; }
            set { this._userType = value; }
        }
        
        /// <summary>
        /// 对比两个UserInfo数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的UserInfo数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成UserInfo数据模型对象
            UserInfoMod userInfoMod = obj as UserInfoMod;
            //判断是否转换成功
            if (userInfoMod == null) return false;
            //进行匹配属性的值
            return
                //判断Id是否一致
                this.Id == userInfoMod.Id &&
                //判断Name是否一致
                this.Name == userInfoMod.Name &&
                //判断Password是否一致
                this.Password == userInfoMod.Password &&
                //判断DeptID是否一致
                this.DeptID == userInfoMod.DeptID &&
                //判断Phone是否一致
                this.Phone == userInfoMod.Phone &&
                //判断ScanCode是否一致
                this.ScanCode == userInfoMod.ScanCode &&
                //判断Email是否一致
                this.Email == userInfoMod.Email &&
                //判断SpellCode是否一致
                this.SpellCode == userInfoMod.SpellCode &&
                //判断Remark是否一致
                this.Remark == userInfoMod.Remark &&
                //判断Validity是否一致
                this.Validity == userInfoMod.Validity &&
                //判断Modify是否一致
                this.Modify == userInfoMod.Modify &&
                //判断NextModify是否一致
                this.NextModify == userInfoMod.NextModify &&
                //判断Forbid是否一致
                this.Forbid == userInfoMod.Forbid &&
                //判断Fax是否一致
                this.Fax == userInfoMod.Fax &&
                //判断CompanyID是否一致
                this.CompanyID == userInfoMod.CompanyID &&
                //判断Role是否一致
                this.Role == userInfoMod.Role &&
                //判断CmdPwd是否一致
                this.CmdPwd == userInfoMod.CmdPwd &&
                //判断UserType是否一致
                this.UserType == userInfoMod.UserType;
        }
        /// <summary>
        /// 将当前UserInfo数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将UserInfo数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将Id进行按位异或运算处理
                (this.Id == null ? 2147483647 : this.Id.GetHashCode()) ^
                //将Name进行按位异或运算处理
                (this.Name == null ? 2147483647 : this.Name.GetHashCode()) ^
                //将Password进行按位异或运算处理
                (this.Password == null ? 2147483647 : this.Password.GetHashCode()) ^
                //将DeptID进行按位异或运算处理
                (this.DeptID == null ? 2147483647 : this.DeptID.GetHashCode()) ^
                //将Phone进行按位异或运算处理
                (this.Phone == null ? 2147483647 : this.Phone.GetHashCode()) ^
                //将ScanCode进行按位异或运算处理
                (this.ScanCode == null ? 2147483647 : this.ScanCode.GetHashCode()) ^
                //将Email进行按位异或运算处理
                (this.Email == null ? 2147483647 : this.Email.GetHashCode()) ^
                //将SpellCode进行按位异或运算处理
                (this.SpellCode == null ? 2147483647 : this.SpellCode.GetHashCode()) ^
                //将Remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将Validity进行按位异或运算处理
                this.Validity.GetHashCode() ^
                //将Modify进行按位异或运算处理
                this.Modify.GetHashCode() ^
                //将NextModify进行按位异或运算处理
                this.NextModify.GetHashCode() ^
                //将Forbid进行按位异或运算处理
                this.Forbid.GetHashCode() ^
                //将Fax进行按位异或运算处理
                (this.Fax == null ? 2147483647 : this.Fax.GetHashCode()) ^
                //将CompanyID进行按位异或运算处理
                (this.CompanyID == null ? 2147483647 : this.CompanyID.GetHashCode()) ^
                //将Role进行按位异或运算处理
                (this.Role == null ? 2147483647 : this.Role.GetHashCode()) ^
                //将CmdPwd进行按位异或运算处理
                (this.CmdPwd == null ? 2147483647 : this.CmdPwd.GetHashCode()) ^
                //将UserType进行按位异或运算处理
                (this.UserType == null ? 2147483647 : this.UserType.GetHashCode());
        }
        /// <summary>
        /// 将当前UserInfo数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前UserInfo数据模型对象转换成字符串副本
            return
                "[" +
                //将Id转换成字符串
                this.Id + "," +
                //将Name转换成字符串
                this.Name + "," +
                //将Password转换成字符串
                this.Password + "," +
                //将Validity转换成字符串
                this.Validity + "," +
                //将Modify转换成字符串
                this.Modify + "," +
                //将NextModify转换成字符串
                this.NextModify + "," +
                //将Forbid转换成字符串
                this.Forbid + "," +
                //将CompanyID转换成字符串
                this.CompanyID +
                "]";
        }
    }
}
